package airAgent.group5;

import airAgent.group5.ontology.ontology.AirAgentOntology;
import jade.content.lang.Codec;
import jade.content.lang.sl.SLCodec;
import jade.content.onto.Ontology;
import jade.core.Agent;
import jade.wrapper.AgentController;
import jade.wrapper.StaleProxyException;

public class Simulation5 extends Agent {

    airAgent.group5.ontology.ontology.Airline ontoAirline = new airAgent.group5.ontology.ontology.Airline();
    private Codec codec = new SLCodec();
    private Ontology ontology = AirAgentOntology.getInstance();

    @Override
    protected void setup() {
        getContentManager().registerLanguage(codec);
        getContentManager().registerOntology(ontology);

        try {
            AgentController timerController = getContainerController().createNewAgent("t5", Timer.class.getName(), null);
            timerController.start();
        } catch (StaleProxyException ex) {
            System.out.println(getLocalName() + ": Cannot create timer agent");
        }

         try {
            AgentController bankController = getContainerController().createNewAgent("b5", Bank.class.getName(), null);
            bankController.start();
        } catch (StaleProxyException ex) {
            System.out.println(getLocalName() + ": Cannot create bank agent");
        }


          try {
            AgentController clientGeneratorController = getContainerController().createNewAgent("cg5", ClientGenerator.class.getName(), null);
            clientGeneratorController.start();
        } catch (StaleProxyException ex) {
            System.out.println(getLocalName() + ": Cannot create client generator agent");
        }
    }
}
